cmake_minimum_required(VERSION 3.14)
# 开启语言支持
include_directories(SYSTEM ${CMAKE_SOURCE_DIR}/include)
project(opskernels LANGUAGES CXX CUDA)
if(CUDA_ENABLED)
    enable_language(CUDA)
endif()
set(CMAKE_CUDA_ARCHITECTURES 52 86 89)

option(BUILD_TESTS "Build Google tests" ON)

# C++17
set(CMAKE_CXX_STANDARD 17)
set(CMAKE_CXX_STANDARD_REQUIRED ON)
set(CMAKE_CXX_EXTENSIONS OFF)
set(CMAKE_CUDA_STANDARD ${CMAKE_CXX_STANDARD})

set(LIBRARY_OUTPUT_PATH ${CMAKE_BINARY_DIR}/libs)
if(BUILD_TESTS)
  message(STATUS "Building Google tests")
else()
  message(STATUS "Not building Google tests")
endif()


if(BUILD_TESTS)
  enable_testing()
  add_subdirectory(tests)
endif()
# 编译库所在路径
add_subdirectory(${CMAKE_SOURCE_DIR}/include)
# message(STATUS "头文件搜索路径${CMAKE_SOURCE_DIR}/include")
add_executable(main main.cc)
# 链接编译后生成的库
target_link_libraries(main ops)
